package ru.vsu.amm.utils;

/**
 * 
 * @author Иванов Илья
 * @since 21 января 2013
 *
 */
public class CommonUtils {

	public static Double[] boxArray(double[] unboxed) {
		if (unboxed == null)
			return null;
		
		Double[] boxed = new Double[unboxed.length];
		for (int i = 0; i < unboxed.length; i++)
			boxed[i] = unboxed[i];
		
		return boxed;
	}
	
	public static double[] unboxArray(Double[] boxed) {
		if (boxed == null)
			return null;
		
		double[] unboxed = new double[boxed.length];
		for (int i = 0; i < boxed.length; i++)
			unboxed[i] = boxed[i];
		
		return unboxed;
	}
}